<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm" novalidate>
                    		<input id="id" name="id" th:value="${business.busiId}"
                               class="form-control" type="hidden">
                            <input id="obusiDesc" name="obusiDesc" th:value="${business.busiDesc}" class="form-control" type="hidden">   
							<input id="oldBusiName" name="oldBusiName" th:value="${business.busiName}" class="form-control" type="hidden">   
							<div class="form-group">
                                <label class="col-sm-2 control-label" >业务元名称：</label>
                                <div class="col-sm-4">
                                    <input id="busiName" name="busiName" class="input-text form-control" th:value="${business.busiName}">
                                </div>
                                <label class="col-sm-2 control-label" >数据类型：</label>
                                <div class="col-sm-4">
                                	<input id="obusiName" name="obusiName" th:value="${business.busiName}" class="form-control" type="hidden">
                                	<select data-placeholder="--请选择数据类型--" name="dataType" id="dataType"
	                                        class="form-control chosen-select" tabindex="2" required>
	                                    <option value="">--请选择数据类型--</option>
	                                    <option value="0" th:selected="${business.dataType==0}">企业</option>
	                                    <option value="1" th:selected="${business.dataType==1}">自然人</option>
	                        		</select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" >业务类型：</label>
                                <input id="obusiType" name="obusiType" th:value="${business.busiType}" class="form-control" type="hidden">
                                <input id="obusiTypeNode" name="obusiTypeNode" th:value="${business.busiTypeNode}" class="form-control" type="hidden">
                                <div class="col-sm-2">
                                    <select data-placeholder="--请选择业务大类--" name="busiType" id="busiType"
	                                        class="form-control chosen-select" tabindex="2" required>
	                                    <option value="">--请选择业务大类--</option>
	                        		</select>
                                </div>
                                <div class="col-sm-2">
                                    <select data-placeholder="--请选择业务小类--" name="busiTypeNode" id="busiTypeNode"
                                       class="form-control chosen-select" tabindex="2" required>
                                       <option value="">--请选择业务小类--</option> 
                           			</select>
                                </div>
                                <label class="col-sm-2 control-label" >开放等级：</label>
                                <div class="col-sm-4">
                                	<input id="oopenLevel" name="oopenLevel" th:value="${business.openLevel}" class="form-control" type="hidden">
                                    <select data-placeholder="--请选择开放等级--" name="openLevel" id="openLevel"
                                       class="form-control chosen-select" tabindex="2" required>
                                       <option value="">--请选择开放等级--</option> 
                           			</select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" >算法类型：</label>
                                <div class="col-sm-4">
                                	<!-- <input id="oalgorithmType" name="oalgorithmType" th:value="${business.algorithmType}" class="form-control" type="hidden"> -->
                                    <select data-placeholder="单项" name="algorithmType" id="algorithmType"
                                       class="form-control chosen-select" tabindex="2" required>
                                       <option value="1" th:selected="${business.algorithmType==1}">单项</option>
                                       <option value="2" th:selected="${business.algorithmType==2}">单表统计</option>
                                       <option value="3" th:selected="${business.algorithmType==3}">自定义</option> 
                                       <option value="4" th:selected="${business.algorithmType==4}">接口访问</option>
                                       <option value="5" th:selected="${business.algorithmType==5}">拆分统计</option>
                           			</select>
                                </div>
                                <label class="col-sm-2 control-label" >链接方式：</label>
                                <div class="col-sm-4">
                                    <select data-placeholder="--请选择--" name="linkWay" id="linkWay" 
                                       class="form-control chosen-select" tabindex="2" required>
                                       <option value="">--请选择--</option>
                                       <option value="3" th:selected="${business.linkWay==3}">无</option>
                                       <option value="0" th:selected="${business.linkWay==0}">明细</option>
                                       <option value="1" th:selected="${business.linkWay==1}">企业信用记录</option>
                                       <option value="2" th:selected="${business.linkWay==2}">自然人信用记录</option>
                                       <option value="4" th:selected="${business.linkWay==4}">企查查接口</option>
                           			</select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" >用途：</label>
                                <div class="col-sm-10" id="dataUseDiv">
                                	<input id="odataUse" name="odataUse" th:value="${business.dataUse}" class="form-control" type="hidden">
                                </div>
                            </div>
                            <!-- 算法为单表统计时的div -->
                            <div id="simpleTable" style="display: none;">
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >数据目录：</label>
	                                <div class="col-sm-4">
	                                	<input id="otableId" name="otableId" th:value="${business.tableId}" class="form-control" type="hidden">
	                                    <select data-placeholder="--请选择表--" name="stTableId" id="stTableId"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择表--</option>
	                           			</select>
	                                </div>
	                                <!-- <div id="detailDiv1" style="display: none;">
		                                <label class="col-sm-2 control-label" >明细字段：</label>
		                                <div class="col-sm-4">
		                                	<input id="odetFieldId" name="odetFieldId" th:value="${business.detFieldId}" class="form-control" type="hidden">
		                                    <input id="stDetFieldId" name="stDetFieldId" class="input-text form-control" required="required" readonly="readonly" onclick="toDetField();" style="background-color: white;">
		                                </div>
	                                </div> -->
	                                <div id="detailDiv1" style="display: none;">
		                                <label class="col-sm-2 control-label" >明细字段：</label>
		                                <div class="col-sm-4">
		                                <input id="odetFieldId" name="odetFieldId" th:value="${business.detColumnId}" class="form-control" type="hidden">
		                                <input id="stDetFieldId" name="stDetFieldId" class="input-text form-control" th:value="${business.detColumnId}" type="hidden">
		                                <input id="stDetFieldName" name="stDetFieldName" class="input-text form-control" required="required" readonly="readonly" onclick="toDetField();" style="background-color: white;">
		                                </div>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >说明：</label>
	                                <div class="col-sm-10">
	                                	<textarea id="stBusiDesc" name="stBusiDesc" rows="8" class="form-control"></textarea>
	                                </div>
	                            </div>
                            </div>
                            <!-- 算法为单项时的div -->
                            <div id="simple" style="">
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >数据目录：</label>
	                                <div class="col-sm-4">
	                                    <select data-placeholder="--请选择表--" name="tableId" id="tableId"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择表--</option>
	                           			</select>
	                                </div>
	                                <label class="col-sm-2 control-label" >数据项：</label>
	                                <div class="col-sm-4">
	                                <input id="ofieldId" name="ofieldId" th:value="${business.columnId}" class="form-control" type="hidden">
	                                    <select data-placeholder="--请选择字段--" name="fieldId" id="fieldId"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择字段--</option>
	                           			</select>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >说明：</label>
	                                <div class="col-sm-10">
	                                	<textarea id="busiDesc" name="busiDesc" rows="8" class="form-control"></textarea>
	                                </div>
	                            </div>
                            </div>
                            <!-- 算法为接口访问 -->
                            <div id="interface" style="display: none;">
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >SringBean：</label>
	                                <div class="col-sm-4">
	                                    <input id="springBean" name="springBean" th:value="${business.springBean}" class="input-text form-control" required>
	                                </div>
	                                <label class="col-sm-2 control-label" >接口名称：</label>
	                                <div class="col-sm-4">
	                                    <input id="interfaceName" name="interfaceName" th:value="${business.interfaceName}" class="input-text form-control" required>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >说明：</label>
	                                <div class="col-sm-10">
	                                	<textarea id="iBusiDesc" name="iBusiDesc" rows="8" class="form-control" ></textarea>
	                                </div>
	                            </div>
                            </div>
                            <!-- 算法为自定义时的div -->
                            <div id="customize" style="display: none;">
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >数据源：</label>
	                                <div class="col-sm-4">
	                                	<input id="odataSource" name="odataSource" th:value="${business.dataSource}" class="form-control" type="hidden">
	                                    <select data-placeholder="--请选择--" name="dataSource" id="dataSource"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择--</option>
	                           			</select>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >自定义sql：</label>
	                                <div class="col-sm-10">
	                                	<input id="obusiSql" name="obusiSql" th:value="${business.busiSql}" class="form-control" type="hidden">
	                                	<textarea id="busiSql" name="busiSql" rows="5" class="form-control" required></textarea>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >说明：</label>
	                                <div class="col-sm-10">
	                                	<textarea id="cBusiDesc" name="cBusiDesc" rows="8" class="form-control"></textarea>
	                                </div>
	                            </div>
	                            <div  id="detailDiv" style="display: none;">
		                            <div class="form-group">
		                                <label class="col-sm-2 control-label" >明细sql：</label>
		                                <div class="col-sm-10">
		                                	<input id="obusiSqldet" name="obusiSqldet" th:value="${business.busiSqldet}" class="form-control" type="hidden">
		                                	<textarea id="busiSqldet" name="busiSqldet" rows="5" class="form-control" required></textarea>
		                                </div>
		                            </div>
		                            <div class="form-group">
		                                <label class="col-sm-2 control-label" >明细说明：</label>
		                                <div class="col-sm-10">
		                                	<input id="obusiDescdet" name="obusiDescdet" th:value="${business.busiDescdet}" class="form-control" type="hidden">
		                                	<textarea id="busiDescdet" name="busiDescdet" rows="8" class="form-control"></textarea>
		                                </div>
		                            </div>
	                            </div>
                            </div>
                            <!-- 算法为拆分统计时 -->
                            <div id="splitStatistics" style="display: none;">
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >数据目录：</label>
	                                <div class="col-sm-4">
	                                    <select data-placeholder="--请选择表--" name="sTableId" id="sTableId"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择表--</option>
	                           			</select>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >数据项：</label>
	                                <div class="col-sm-4">
	                                    <select data-placeholder="--请选择字段--" name="sFieldId" id="sFieldId"
	                                       class="form-control chosen-select" tabindex="2" required>
	                                       <option value="">--请选择字段--</option>
	                           			</select>
	                                </div>
	                                <label class="col-sm-2 control-label" >字段值：</label>
	                                <div class="col-sm-4">
	                                    <input id="fieldValue" name="fieldValue" th:value="${business.columnValue}" class="input-text form-control" required="required">
	                                </div>
	                            </div>
	                            <div class="form-group">
	                            	<div id="detailDiv2" style="display: none;">
		                                <label class="col-sm-2 control-label" >明细字段：</label>
		                                <div class="col-sm-4">
		                                <!-- <input id="odetFieldId" name="odetFieldId" th:value="${business.detColumnId}" class="form-control" type="hidden"> -->
		                                <input id="sDetFieldId" name="sDetFieldId" class="input-text form-control" th:value="${business.detColumnId}" type="hidden">
		                                <input id="sDetFieldName" name="sDetFieldName" class="input-text form-control" required="required" readonly="readonly" onclick="toDetField();" style="background-color: white;">
		                                </div>
	                                </div>
	                            </div>
	                            <div class="form-group">
	                                <label class="col-sm-2 control-label" >说明：</label>
	                                <div class="col-sm-10">
	                                	<textarea id="sBusiDesc" name="sBusiDesc" rows="8" class="form-control"></textarea>
	                                </div>
	                            </div>
                            </div>
                            <div class="form-group">
								<div class="col-sm-8 col-sm-offset-6">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript"> var ctx = [[@{/}]] ; </script>
<script type="text/javascript" src="/js/app/metadata/business/edit.js" th:src="@{/js/app/metadata/business/edit.js}">
</script>
</body>
</html>
